
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Git · 尹自强.Note</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="尹自强">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/yzq.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Git.html" />
    
    
    <link rel="prev" href="Golang.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://github.com/554393109" target="_blank" class="custom-link">作者GitHub</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    在线笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="Golang.html">
            
                <a href="Golang.html">
            
                    
                    Golang
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="Golang.html">
            
                <a href="Golang.html#安装与配置">
            
                    
                    安装与配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="Golang.html">
            
                <a href="Golang.html#语法">
            
                    
                    语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="Golang.html">
            
                <a href="Golang.html#常用命令">
            
                    
                    常用命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="Git.html">
            
                <a href="Git.html">
            
                    
                    Git
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="Git.html">
            
                <a href="Git.html#版本管理流程">
            
                    
                    版本管理流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="Git.html">
            
                <a href="Git.html#常用命令">
            
                    
                    常用命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="GitBook.html">
            
                <a href="GitBook.html">
            
                    
                    GitBook
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="GitBook.html">
            
                <a href="GitBook.html#项目结构">
            
                    
                    项目结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="GitBook.html">
            
                <a href="GitBook.html#常用插件">
            
                    
                    常用插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="GitBook.html">
            
                <a href="GitBook.html#常用命令">
            
                    
                    常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="GitBook.html">
            
                <a href="GitBook.html#常见问题">
            
                    
                    常见问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="Nuget.html">
            
                <a href="Nuget.html">
            
                    
                    Nuget
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="Nuget.html">
            
                <a href="Nuget.html#私有源服务器搭建">
            
                    
                    私有源服务器搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="Nuget.html">
            
                <a href="Nuget.html#nuspec文件解析">
            
                    
                    nuspec文件解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="Nuget.html">
            
                <a href="Nuget.html#常用命令">
            
                    
                    常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="Nuget.html">
            
                <a href="Nuget.html#相关资源">
            
                    
                    相关资源
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="Npm.html">
            
                <a href="Npm.html">
            
                    
                    NPM
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="Npm.html">
            
                <a href="Npm.html#常用命令">
            
                    
                    常用命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="SiteConsole.html">
            
                <a href="SiteConsole.html">
            
                    
                    网站Console
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="Docker.html">
            
                <a href="Docker.html">
            
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="Docker.html">
            
                <a href="Docker.html#Dockerfile">
            
                    
                    Dockerfile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="Docker.html">
            
                <a href="Docker.html#常用命令">
            
                    
                    常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="Docker.html">
            
                <a href="Docker.html#常用镜像">
            
                    
                    常用镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="Docker.html">
            
                <a href="Docker.html#相关资源">
            
                    
                    相关资源
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="Skill.html">
            
                <a href="Skill.html">
            
                    
                    技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="Tools.html">
            
                <a href="Tools.html">
            
                    
                    常用工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="bio.html">
            
                <a href="bio.html">
            
                    
                    个人履历
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Git</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#&#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;"><b>1. </b>&#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;</a></li><li><span class="title-icon "></span><a href="#&#x5E38;&#x7528;&#x547D;&#x4EE4;"><b>2. </b>&#x5E38;&#x7528;&#x547D;&#x4EE4;</a></li></ul></div><a href="#&#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><p><b style="font-size: 2em">Git</b></p>
<hr>
<h1 id="&#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;"><a name="&#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;" class="anchor-navigation-ex-anchor" href="#&#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;</h1>
<p><a href="../assets/git_flow.jpg" title="&#x70B9;&#x51FB;&#x9884;&#x89C8;" target="_blank"><img src="../assets/git_flow.jpg" style="zoom:100%" alt="&#x7248;&#x672C;&#x7BA1;&#x7406;&#x6D41;&#x7A0B;"></a></p>
<hr>
<h1 id="&#x5E38;&#x7528;&#x547D;&#x4EE4;"><a name="&#x5E38;&#x7528;&#x547D;&#x4EE4;" class="anchor-navigation-ex-anchor" href="#&#x5E38;&#x7528;&#x547D;&#x4EE4;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x5E38;&#x7528;&#x547D;&#x4EE4;</h1>
<pre class="language-"><code class="lang-bash">// &#x5728;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x521D;&#x59CB;&#x5316;&#x4E3A;Git&#x4EE3;&#x7801;&#x5E93;
<span class="token operator">&gt;</span> <span class="token function">git</span> init

// &#x5728;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x4E0B;&#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#xFF0C;&#x5E76;&#x5C06;&#x5176;&#x521D;&#x59CB;&#x5316;&#x4E3A;Git&#x4EE3;&#x7801;&#x5E93;
<span class="token operator">&gt;</span> <span class="token function">git</span> init <span class="token punctuation">{</span>&#x76EE;&#x5F55;&#x540D;&#x79F0;<span class="token punctuation">}</span>

// &#x4E0B;&#x8F7D;&#x4E00;&#x4E2A;&#x9879;&#x76EE;&#x548C;&#x5B83;&#x7684;&#x6574;&#x4E2A;&#x4EE3;&#x7801;&#x5386;&#x53F2;
<span class="token operator">&gt;</span> <span class="token function">git</span> clone <span class="token punctuation">{</span>url<span class="token punctuation">}</span>

---

// &#x663E;&#x793A;&#x5F53;&#x524D;&#x7684;Git&#x914D;&#x7F6E;
<span class="token operator">&gt;</span> <span class="token function">git</span> config <span class="token parameter variable">--list</span>

// &#x7F16;&#x8F91;&#x5F53;&#x524D;&#x7684;Git&#x914D;&#x7F6E;
<span class="token operator">&gt;</span> <span class="token function">git</span> config <span class="token parameter variable">-e</span> <span class="token punctuation">[</span>--global<span class="token punctuation">]</span>

// &#x8BBE;&#x7F6E;&#x63D0;&#x4EA4;&#x4EE3;&#x7801;&#x662F;&#x7684;&#x7528;&#x6237;&#x4FE1;&#x606F;
<span class="token operator">&gt;</span> <span class="token function">git</span> config <span class="token punctuation">[</span>--global<span class="token punctuation">]</span> user.name <span class="token string">&quot;{name}&quot;</span>
<span class="token operator">&gt;</span> <span class="token function">git</span> config <span class="token punctuation">[</span>--global<span class="token punctuation">]</span> user.email <span class="token string">&quot;{email}&quot;</span>

---

// &#x67E5;&#x770B;&#x72B6;&#x6001;
<span class="token operator">&gt;</span> <span class="token function">git</span> status

// &#x67E5;&#x770B;&#x53D8;&#x66F4;&#x5185;&#x5BB9;
<span class="token operator">&gt;</span> <span class="token function">git</span> <span class="token function">diff</span>

// &#x6DFB;&#x52A0;&#x6307;&#x5B9A;&#x6587;&#x4EF6;&#x5230;&#x6682;&#x5B58;&#x533A;
<span class="token operator">&gt;</span> <span class="token function">git</span> <span class="token function">add</span> <span class="token punctuation">{</span>file1<span class="token punctuation">}</span> <span class="token punctuation">{</span>file2<span class="token punctuation">}</span> <span class="token punctuation">..</span>.

// &#x6DFB;&#x52A0;&#x6307;&#x5B9A;&#x76EE;&#x5F55;&#xFF08;&#x9012;&#x5F52;&#xFF09;&#x5230;&#x6682;&#x5B58;&#x533A;
<span class="token operator">&gt;</span> <span class="token function">git</span> <span class="token function">add</span> <span class="token punctuation">{</span>dir<span class="token punctuation">}</span>

// &#x6DFB;&#x52A0;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x7684;&#x6240;&#x6709;&#x6587;&#x4EF6;&#x5230;&#x6682;&#x5B58;&#x533A;
<span class="token operator">&gt;</span> <span class="token function">git</span> <span class="token function">add</span> <span class="token builtin class-name">.</span>
</code></pre>
<p><strong>&#x540D;&#x8BCD;</strong></p>
<ul>
<li>master&#xFF1A;&#x9ED8;&#x8BA4;&#x5F00;&#x53D1;&#x5206;&#x652F;</li>
<li>origin&#xFF1A;&#x9ED8;&#x8BA4;&#x8FDC;&#x7A0B;&#x7248;&#x672C;&#x5E93;</li>
<li>Index / Stage&#xFF1A;&#x6682;&#x5B58;&#x533A;</li>
<li>Workspace&#xFF1A;&#x5DE5;&#x4F5C;&#x533A;</li>
<li>Repository&#xFF1A;&#x4ED3;&#x5E93;&#x533A;&#xFF08;&#x6216;&#x672C;&#x5730;&#x4ED3;&#x5E93;&#xFF09;</li>
<li>Remote&#xFF1A;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;</li>
</ul>
<footer class="page-footer"><span class="copyright">&#xA9; &#x5C39;&#x81EA;&#x5F3A; all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><a id="link_icp" href="http://www.beian.miit.gov.cn/" target="_blank">&#x7CA4;ICP&#x5907;18161097&#x53F7;</a>&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;
2024-05-11 11:35:00
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Golang.html#常用命令" class="navigation navigation-prev " aria-label="Previous page: 常用命令">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Git.html#版本管理流程" class="navigation navigation-next " aria-label="Next page: 版本管理流程">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Git","level":"1.3","depth":1,"next":{"title":"版本管理流程","level":"1.3.1","depth":2,"anchor":"#版本管理流程","path":"chapter/Git.md","ref":"chapter/Git.md#版本管理流程","articles":[]},"previous":{"title":"常用命令","level":"1.2.3","depth":2,"anchor":"#常用命令","path":"chapter/Golang.md","ref":"chapter/Golang.md#常用命令","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","-lunr","-search","search-pro","anchor-navigation-ex","splitter","github","tbfed-pagefooter","prism","alerts","donate","copy-code-button","advanced-emoji","expandable-chapters"],"styles":{"website":"styles/yzq.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"&copy 尹自强","modify_label":"<a id='link_icp' href='http://www.beian.miit.gov.cn/' target='blank'>粤ICP备18161097号</a>文件修订时间","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{},"github":{"url":"https://github.com/554393109"},"splitter":{},"search-pro":{},"donate":{"alipay":"../../assets/donate_alipay.jpg","alipayText":"支付宝打赏","button":"打赏","title":"","wechat":"../../assets/donate_wechat.jpg","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":1},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"alerts":{},"copy-code-button":{},"advanced-emoji":{"embedEmojis":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"尹自强","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"尹自强.Note","language":"zh-hans","links":{"sidebar":{"作者GitHub":"https://github.com/554393109"}},"gitbook":"3.2.3","description":"尹自强.Note"},"file":{"path":"chapter/Git.md","mtime":"2024-05-11T03:35:00.895Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2025-01-16T03:02:01.896Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

